package fr.miage.orleans.aar.modele;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

/**
 *
 * @author Steve Cancès <steve.cances@gmail.com>
 */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(schema = Modele.SCHEMA_NAME)
public class ButTirAuBut extends But implements Comparable<ButTirAuBut> {

    /**
     * Reussite du tir au but
     */
    private boolean reussi;

    /**
     * Rang du tir au but au sein de la serie de tirs au but
     */
    private int rang;

    public boolean isReussi() {
        return reussi;
    }

    public void setReussi(boolean reussi) {
        this.reussi = reussi;
    }

    public int getRang() {
        return rang;
    }

    public void setRang(int rang) {
        this.rang = rang;
    }

	@Override
	public int compareTo(ButTirAuBut o) {
		ButTirAuBut b = (ButTirAuBut)o;
		if(o.getRang()>rang) return -1;
		else return 1;
	}

}
